<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<link rel="stylesheet" href="<%=path%>/css/manager/news2.css">
<script type="text/javascript"
	src="<%=path%>/js/manager/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=path%>/js/jedate/jedate.js"></script>
<script type="text/javascript"
	src="<%=path%>/js/manager/news2.js"></script>
<!-- ueditor编辑器 -->
<script type="text/javascript" charset="utf-8" src="/forumsystem/js/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/forumsystem/js/utf8-jsp/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/forumsystem/js/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
	//实例化编辑器
	 var ue = UE.getEditor('editor');
	//对编辑器的操作最好在编辑器ready之后再做
	 ue.ready(function() {
	     //设置编辑器的内容
	     ue.setContent($("#newsContent").val());
	     //获取html内容，返回: <p>hello</p>
	     var html = ue.getContent();
	      
	 });
	<%--  <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
	 <input type="hidden" id="newsContent"  name="newsContent" value='${news.newsContent}'/> --%>
</script>
<title>论坛管理-编辑理事动态</title>
</head>
 
<body>
<input type="hidden" value="${news.newsId}"/>
	<!--
			页面重复使用表
			新闻，要闻，公告通知；
			论坛管理：添加理事动态；
			诚聘精英，
			/编辑，同样使用此页面/
		-->
	<!--
        	作者：offline
        	时间：2016-12-22
        	描述：新闻内容头部（统一，部分二级字体颜色单独修改）
        -->
	<div class="news_div1">
		<div class="news_div1_div1">论坛管理</div>
		<div class="news_div1_div2">
			<a href="<%=path%>/basicctr/bbsbasic.htm?markManage=3"
				class="news_div1_div2_div1">论坛概况</a> <a>|</a> <a
				href="<%=path%>/organize/olist.htm" class="news_div1_div2_div2">机构设置</a>
			<a>|</a> <a href="###" class="news_div1_div2_div3 ablack">理事动态</a>
		</div>
	</div>
	<!--
        	作者：offline
        	时间：2016-12-22
        	描述：添加/编辑，新闻（内容）
        -->
	<div class="news2_div2">
		<form action="newsmange.htm" id="sform" method="post">
			<input type="hidden" name="condition" value="${news.condition}" /> <input
				type="hidden" id="pageIndex" name="pageInfo.pageIndex"
				value="${news.pageInfo.pageIndex}" /> <input type="hidden"
				id="pageSize" name="pageInfo.pageSize" value="${news.pageInfo.pageSize}" />
			<input type="hidden" id="newsType" name="newsType"
				value="${news.newsType}" /> <input type="hidden" id="markManage"
				name="markManage" value="${news.markManage}" /> <input
				type="hidden" id="newsId" name="newsId" value="${news.newsId}" />
				<input type="hidden" id="sysuserId" name="newsAdduser" value="${back_user.sysuserId}"/>
			<div class="news2_div2_div1">
				<span class="news2_div2_div1_sp1"><c:if
						test="${news.markManage==1}">添加</c:if><c:if test="${news.markManage==2}">编辑</c:if><c:if
						test="${news.newsType==1}">新闻动态</c:if><c:if
						test="${news.newsType==2}">近期要闻</c:if><c:if
						test="${news.newsType==3}">公告通知</c:if><c:if
						test="${news.newsType==4}">理事动态</c:if></span>
			</div>
			<div class="news2_div2_div2">
				<div class="news2_div2_div2_div1">
					<c:if test="${news.newsType==1}">新闻动态</c:if>
					<c:if test="${news.newsType==2}">近期要闻</c:if>
					<c:if test="${news.newsType==3}">公告通知</c:if>
					<c:if test="${news.newsType==4}">理事动态</c:if>标题
				</div>
				<input class="news2_div2_div2_in1" type="text" placeholder="输入新闻标题"
					maxlength="80" name="newsTheme" id="newsTheme"
					value="${news.newsTheme}" />
				<div class="news2_div2_div2_div2">
					还能输入<em>80</em>个字
				</div>
			</div>
			<div class="news2_div2_div3">
				<div class="news2_div2_div3_div1">
					<c:if test="${news.newsType==1}">新闻动态</c:if>
					<c:if test="${news.newsType==2}">近期要闻</c:if>
					<c:if test="${news.newsType==3}">公告通知</c:if>
					<c:if test="${news.newsType==4}">理事动态</c:if>内容
				</div>
				<div class="news2_div2_div3_div2">
					<p class="news2_div2_div3_div2_p1">1、图片尺寸为：每张图片不超过1024kb，仅支持jpg.jpeg.和png.格式；</p>
					<p class="news2_div2_div3_div2_p2">2、图片要清晰，不能虚化。</p>
					<div class="" >
						<%-- <textarea id="content" name="newsContent">${news.newsContent}</textarea> --%>
							<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
						    <input type="hidden" id="newsContent"  name="newsContent" value='${news.newsContent}'/>
					</div>
				</div>
				<div class="clearboth"></div>
			</div>
			<div class="news2_div2_div4">
				<div class="news2_div2_div4_div1">发布时间</div>
				<input class="news2_div2_div4_in1" type="text" id="datebut"
					value="${news.newsPublisTime_sel}" name="newsPublisTime_sel" /> <input
					class="news2_div2_div4_in2" type="button"
					onClick="jeDate({dateCell:'#datebut',isTime:true,format:'YYYY-MM-DD hh:mm:ss'})" />
			</div>
			<div class="news2_div2_div5">
				<input class="news2_div2_div5_in1" type="submit"
					onclick="return submitCheck()" value="" /> <input
					class="news2_div2_div5_in2" type="button" onclick="return back()" />
			</div>
		</form>
	</div>
</body>
<script>
	$(".news2_div2_div2_div2 em")
</script>
<script type="text/javascript">
	//提交验证
	function submitCheck() {
		//验证管理员登录
		var sysuserId=$("#sysuserId").val();
		if(sysuserId.length==0){
			alert("管理员登录失效，请重新登录");
			window.open("<%=path%>/login/beforelogin.htm");
			return false;
		}
		//标题
		var newsTheme = $.trim($("#newsTheme").val());
		if (newsTheme.length == 0) {
			alert("动态名称不能为空！");
			$("#newsTheme").focus();
			return false;
		} else {
			$("#newsTheme").val(newsTheme);
		}

		//发布时间
		var reTimeReg = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/;
		var datebut = $("#datebut").val();
		if (datebut.length == 0) {
			alert("请选择发布时间！");
			return false;
		} else if (!reTimeReg.test(datebut)) {
			alert("时间格式应为'yyyy-MM-dd HH:mm:ss'");
			$("#datebut").focus();
			return false;
		}
		return true;
	}
	//返回事件
	function back() {
		$("#sform").attr("action", "newslist.htm");
		$("#sform").submit();
	}
</script>
</html>

